package com.camel.core.feign;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;

public class InfoFeignLogger extends feign.Logger {
    private final Logger logger;

    public InfoFeignLogger(Logger logger) {
        this.logger = logger;
    }

    @Override
    protected void log(String configKey, String format, Object... args) {
        if(!"%s: %s".equals(format) && StringUtils.isNotBlank(format)) {
            String formatStr = String.format(methodTag(configKey) + format, args);
            if(configKey.contains("AutoCallServiceService")) {
                formatStr = "自动外呼服务: " + formatStr;
            }
            logger.info(formatStr);
        }
    }
}
